package main.utils 
{   
    import flash.display.LoaderInfo;
    import flash.system.ApplicationDomain;
    
    /**
     * 
     * @author Fern
     */
    public class GetClass 
    {
        public static function getClass(p_name:String, p_info:LoaderInfo=null):Class
        {
			try
            {
				if (p_info == null)
                {
					return ApplicationDomain.currentDomain.getDefinition(p_name) as Class;
                }
                else
                {
                    return p_info.applicationDomain.getDefinition(p_name) as Class;
                }
			} 
            catch (p_e : ReferenceError) 
            {
                trace("get class failed : name=" + p_name + ":" + p_e.message);
				return null;
			}            
            // never run.
			return null;
        }
        
    }
    
}